<h3>Submit a <?php echo $doc_type?> </h3>

<p>
	<?php echo $info ?>
</p>

<div id="attachment_list">
	<?php echo $this->Session->flash('al'); ?>
	<span>Submitted <?php echo $doc_type ?></span>
		<table cellpadding="0" cellspacing="0">
			<tr><th>File Name:</th><th>File size:</th><th>Submission Date:<br />(YYYY-MM-DD)</th><th>Remove Submission:</th></tr>
		<?php
		foreach ($data as $line => $at) {
				echo (($line+1)%2==1)? '<tr class="odd">': '<tr class="even">';
				echo "\n<td>" . $this->Html->link($at['Attachment']['file_name'], array(
																						'controller' => 'Attachments', 
																						'action' => 'view',
																						$at['Attachment']['id'])) . "</td>";
				echo "\n<td>{$at['Attachment']['file_size']}</td>";
			
				$date = explode(' ', $at['Attachment']['modified']);
				$date = $date[0];
				echo "<td>{$date}</td>";
				echo '<td>' . $html->link('remove', array('controller' => 'Attachments', 
																		'action' => 'delete', $at['Attachment']['id']), null, 
																		'Are you sure your want to remove this submission?');
				echo "</td>";
				echo '</tr>';
		}
		?>
		</table>
	</div><!--end attachment_list-->
	<hr />
	<?php echo $this->Form->create('Attachment', array('type' => 'file', 
																										 'url' => array('action' => 'add', $app_id, $dt))); ?>
	<?php echo $this->Form->input('doc_type', array('type' => 'hidden', 'value' =>  $dt)); ?>
	<?php echo $this->Form->input('application_id', array('type' => 'hidden', 'value' => $app_id)); ?>
	<?php echo $this->Form->input('Attachment.content', array('label' => 'Upload File', 'type' => 'file')); ?>
	<?php echo $this->Form->end('Add Document'); ?>

